#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "TIM_InputCapture.h"
#include "PWM.h"


extern uint16_t frequency;

extern uint16_t duty_cycle;

extern uint16_t paule_width_ccr_val;

extern uint16_t feq_ccr_val;
int main(void)
{
	/*模块初始化*/
	OLED_Init();		//OLED初始化
	
    pwm_init();
    
    init_capture_pwm();
    
	/*OLED显示*/

	OLED_ShowString(1, 1, "Frequency:");	//1行3列显示字符串HelloWorld!
	
    OLED_ShowString(2, 6, "Hz");
    OLED_ShowString(3, 1, "Duty Cycle:");
	OLED_ShowString(3, 14, "%");
	while (1)
	{
		OLED_ShowNum(2,1,frequency,5);
        OLED_ShowNum(3,12,duty_cycle,2);
        OLED_ShowNum(4,1,paule_width_ccr_val,5);
        OLED_ShowNum(4,8,feq_ccr_val,5);
        Delay_s(1);
	}
}
